<?php
class Form_Registration extends Zend_Form
{
    public function init ()
    {
        $login = $this->createElement('text', 'login');
        $login->addFilter('StringTrim')
            ->addFilter('StripTags')
            ->setRequired(true)
            ->addValidator('NotEmpty')
            ->addValidator('Alnum')
            ->addValidator('Db_NoRecordExists', false, 
        		array('table' => 'users', 'field' => 'login'));
        $this->addElement($login);
        
        
        $password = $this->createElement('text', 'email');
        $password->setRequired(true)
            ->addValidator('Db_NoRecordExists', false, 
        array('table' => 'users', 'field' => 'email'))
            ->addValidator('NotEmpty')
            ->addValidator('EmailAddress');
        $this->addElement($password);
        
        
        $rememberme = $this->createElement('checkbox', 'wason');
        $this->addElement($rememberme);
    }
}
?>
